#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
#include <assert.h>

char* my_strncpy(char* arr1, const char* arr2, size_t num)
{
	assert(arr1 && arr2);
	char* ret = arr1;
	while (num--)
	{
		*arr1 = *arr2;
		arr1++;
		arr2++;
	}
	return ret;
}
int main()
{
	char arr1[20] = "0";
	char arr2[] = "abcdeggf";
	my_strncpy(arr1,arr2,5);
	printf("%s", arr1);
	return 0;
}